﻿@model PagedList.IPagedList<CultuRAM.Models.Event>

@{
    ViewBag.Title = "Lista de Eventos";
}

<div class="row-fluid">
    <div class="span2">
        
        <div id="FilterEventList">
            
            <h4><i class="icon-filter" style="margin-top: 3px;"></i> Filtrar Por:</h4>

            <!-- Collapse
                ================================================== --> 
            <div class="accordion" id="accordFilterEvList" style="margin-bottom: 10px !important;">
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse1">
                            <b>Tipo</b>
                        </a>
                    </div>
                    <div id="collapse1" class="accordion-body collapse">
                        <div class="accordion-inner">
                            @Html.DropDownList("EventTypeIdEv", (IEnumerable<SelectListItem>)ViewBag.EventTypeIdEv,"", new { @class="span17" })
                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse2">
                            <b>Título</b>
                        </a>
                    </div>
                    <div id="collapse2" class="accordion-body collapse">
                        <div class="accordion-inner">
                            <input id="txtTitleEv" class="input-medium" type="text" placeholder="Insira o texto">   
                            @*@Html.TextBox(txtTitle,new {@class="input-medium"})  *@       
                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse3">
                            <b>Data/Hora ou Período</b>
                        </a>
                    </div>
                    <div id="collapse3" class="accordion-body collapse">
                        <div class="accordion-inner">
                            <div id="datetimepickerStartEv"  class="input-append date">
                                <input id="txtDateStartEv" class="input-small datepicker" style = "width: 123px !important;" type="text" placeholder="Data de Início" data-format="dd/MM/yyyy">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                </span>
                            </div>
                            <div id="datetimepickerEndEv"  class="input-append date">
                                <input id="txtDateEndEv" class="input-small datepicker" style = "width: 123px !important;" type="text" placeholder="Data de Fim" data-format="dd/MM/yyyy">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                </span>
                            </div>
                            @Html.DropDownList("PeriodIdEv", (IEnumerable<SelectListItem>)ViewBag.PeriodIdEv, new { @class="span17", @placeholder="Período", style="margin-bottom: 5px !important;" })
                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse4">
                            <b>Local</b>
                        </a>
                    </div>
                    <div id="collapse4" class="accordion-body collapse">
                        <div class="accordion-inner">
                            @Html.DropDownList("PlaceIdEv", (IEnumerable<SelectListItem>)ViewBag.PlaceIdEv,"", new { @class="span17" })
                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse5">
                            <b>Estado</b>
                        </a>
                    </div>
                    <div id="collapse5" class="accordion-body collapse">
                        <div class="accordion-inner">
                            @Html.DropDownList("StateIdEv", (IEnumerable<SelectListItem>)ViewBag.StateIdEv,"", new { @class="span17" })
                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse6">
                            <b>Público</b>
                        </a>
                    </div>
                    <div id="collapse6" class="accordion-body collapse">
                        <div class="accordion-inner">
                            <label class="radio inline">
                                <input type="radio" name="radPublic" id="radPublic1" value="na" checked> N/A    
                            </label>
                            <label class="radio inline">
                                <input type="radio" name="radPublic" id="radPublic2" value="true"> Sim    
                            </label>
                            <label class="radio inline">
                                <input type="radio" name="radPublic" id="radPublic3" value="false"> Não
                            </label>

                        </div>
                    </div>
                </div>
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordFilterEvList" href="#collapse7">
                            <b>Entidade</b>
                        </a>
                    </div>
                    <div id="collapse7" class="accordion-body collapse">
                        <div class="accordion-inner">
                            @Html.DropDownList("EntityIdEv", (IEnumerable<SelectListItem>)ViewBag.EntityIdEv,"", new { @class="span17" })
                        </div>
                    </div>
                </div>

            </div>

            <div style="text-align: center;">
                <a class = "btn btn-default" style="width: 87%; margin-top: 0px; margin-bottom: 10px" OnClick="ClearFiltersEventList()"><i class="icon-trash"></i>  Limprar Filtros</a>
            </div>
   
        </div>
        
        <div id="ExportOptions">
            
            <h4><i class="fa fa-share-square-o" style="margin-top: 3px;"></i> Exportar para:</h4>
            <div style="text-align: center;">
                @*<a id="btnExportIcal" class="btn btn-small btn-default" style="padding: 0 15px 0 15px; font-weight: bold;">iCAL</a>
                <a id="btnExportJson" class="btn btn-small btn-default" style="padding: 0 15px 0 15px; font-weight: bold;">JSON</a>
                <a id="btnExportXml" class="btn btn-small btn-default" style="padding: 0 15px 0 15px; font-weight: bold;">XML</a>*@
                @Ajax.ActionLink("iCAL", "ExportICal", new { sortOrder=ViewBag.CurrentSort, stringFilter = ViewBag.CurrentFilter },
                             new AjaxOptions
                                 {
                                     UpdateTargetId="tabEvents", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET" 
                                 }, 
                             new { @class = "btn btn-small btn-default", style="padding: 0 15px 0 15px; font-weight: bold;" })
                
                @Ajax.ActionLink("JSON", "ExportJson", new { sortOrder=ViewBag.CurrentSort, stringFilter = ViewBag.CurrentFilter },
                             new AjaxOptions
                                 {
                                     UpdateTargetId="tabEvents", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET" 
                                 }, 
                             new { @class = "btn btn-small btn-default", style="padding: 0 15px 0 15px; font-weight: bold;" })

                @Ajax.ActionLink("XML", "ExportXml", new { sortOrder=ViewBag.CurrentSort, stringFilter = ViewBag.CurrentFilter },
                             new AjaxOptions
                                 {
                                     UpdateTargetId="tabEvents", 
                                     InsertionMode = InsertionMode.Replace, 
                                     HttpMethod = "GET" 
                                 }, 
                             new { @class = "btn btn-small btn-default", style="padding: 0 15px 0 15px; font-weight: bold;" })
            
             
            
            
            </div>

        </div>

        </div>
    <div class="span10" style="min-height: 529px; position: relative;">
        <div id="tabEvents" >
            @Html.Partial("_IndexPv")
        </div>
        
    </div>
</div>


@Scripts.Render("~/bundles/culturam")